package com.yunji.order.dao.impl;

import com.yunji.common.base.BaseDaoImpl;
import com.yunji.order.dao.IOrderDetailDao;
import com.yunji.order.domain.OrderDetailDO;
import com.yunji.order.mapper.IOrderDetailMapper;
import org.springframework.stereotype.Repository;

import java.util.Collections;
import java.util.List;

/**
 * @author : peter-zhu
 * @date : 2025/3/18 15:26
 * @description : TODO
 **/
@Repository
public class OrderDetailDaoImpl extends BaseDaoImpl<IOrderDetailMapper, OrderDetailDO> implements IOrderDetailDao {
    @Override
    public List<OrderDetailDO> getListByOid(Long orderId) {
        return lambdaQuery().eq(OrderDetailDO::getOrderId, orderId).list();
    }

    @Override
    public List<OrderDetailDO> getListByOds(List<Long> orderIds) {
        return lambdaQuery().in(OrderDetailDO::getOrderId, orderIds).list();
    }

    @Override
    public List<String> getNamesByOrderId(Long orderId) {
        return baseMapper.getNamesByOrderId(orderId);
    }
}
